<template>
  <app-config-provider>
    <view class="outer-app-demo-form">
      <je-func
        class="func-height"
        :readonly="isReadonly"
        func-code="HR_QJSQ"
        is-func-form
        :bean-id="beanId"
      />
    </view>
  </app-config-provider>
</template>

<script>
  import { onMounted, defineComponent, onBeforeMount, reactive, toRefs } from 'vue';
  import { onLoad, onBackPress } from '@dcloudio/uni-app';
  export default defineComponent({
    name: 'Maps',
    components: {},
    setup() {
      const state = reactive({ beanId: '', isReadonly: false });
      onBeforeMount(() => {});
      onMounted(() => {});
      // 加载
      onLoad((e) => {
        state.beanId = e.id || '';
        state.isReadonly = e.id;
      });
      // 返回
      onBackPress((e) => {
        if (e.from == 'backbutton') {
          uni.$emit('updateData');
          uni.navigateBack({
            delta: 1, //返回:
          });
          return true;
        }
      });
      return { ...toRefs(state) };
    },
  });
</script>
<style lang="scss" scoped>
  .outer-app-demo-form {
    width: 100%;
    height: calc(100vh - var(--window-top)) !important;
  }
</style>
